package com.complex.spring.advance.aop.cglib.sample;

import net.sf.cglib.proxy.Enhancer;
/**
 * 通过增加器Enhancer,产生子类
 * @author gao
 *
 */
public class Main {
	public static void main(String[] args) {
		//Enhancer ehhancer=new Enhancer();
		//ehhancer.setSuperclass(Requestable.class);
		//ehhancer.setCallback(new RequestCtrlCallback());
		//Requestable proxy = (Requestable)ehhancer.create();
		Requestable proxy = (Requestable)Enhancer.create(Requestable.class, null, new RequestCtrlCallback());
		proxy.request();
	}
}
